import 'package:freemusic/model/AbstractDiss.dart';

class QQDiss extends AbstractDiss {
  String creatorNick;
  String headpic;
  int dirid;
  String picurl;
  String title;
  String subtitle;
  int icontype;
  String iconurl;
  int isshow;
  int dirshow;

  @override
  List<QQDiss> fromRemoteJson(Map json){
    
    List<QQDiss> result = new List();
        
    final List mymusics = json['data']['mymusic'];
    //我喜欢
    dynamic mymusic = mymusics[0];
    QQDiss qqDiss = QQDiss();
    qqDiss.id = int.parse(mymusic['id']);
    qqDiss.dirid = mymusic['dirid'];
    qqDiss.picurl = mymusic['laypic'];
    qqDiss.title = mymusic['title'];
    qqDiss.subtitle = mymusic['subtitle'];
    result.add(qqDiss);

    //自己创建的歌单
    final List infoList = json['data']['mydiss']["list"];
    infoList.forEach((item){
      QQDiss qqDiss = QQDiss();
      qqDiss.id = item['dissid'];
      qqDiss.dirid = item['dirid'];
      qqDiss.picurl = item['picurl'];
      qqDiss.title = item['title'];
      qqDiss.subtitle = item['subtitle'];
      qqDiss.icontype = item['icontype'];
      qqDiss.iconurl = item['iconurl'];
      qqDiss.isshow = item['isshow'];
      qqDiss.dirshow = item['dirshow'];
      result.add(qqDiss);
    });
    return result;
  }

}